<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 编写一个函数求两个数字之间有多少个质数 例如：fn(100, 200) ，在控制台输出 100 - 200 之间的所有质数

        function prime(a,b) {
            for (var c = a; c <= b; c++) {
                var count = 0;
                for (var i = 1; i <= c; i++) {
                    if (c % i == 0) {
                        count++;
                    }
                }
                if (count == 2) {
                    console.log(c);
                }
            }
        }
        prime(100,200);
    </script>
</body>

</html>